﻿<cfcomponent 
	displayname="public.service.helper.tagZip" 
	hint="CFZip Tag Operation Helper" 
	output="false">
	
	<cffunction name="init" access="public" returntype="public.service.helper.tagZip" hint="初始化对象">
		<cfreturn this />
	</cffunction>
	
	<cffunction name="addFile" access="public" returntype="void" hint="将指定文件添加到压缩文件">
		<cfargument name="zipfile" type="string" required="yes" hint="压缩文件的保存物理路径" />
		<cfargument name="source" type="string" required="yes" hint="源文件的物理路径" />
		
		<cfzip source="#arguments.source#" action="zip" file="#arguments.zipfile#" />
		
	</cffunction>
	
	<cffunction name="addDirectory" access="public" returntype="void" hint="将指定文件夹添加到压缩文件">
		<cfargument name="zipfile" type="string" required="yes" hint="压缩文件的保存物理路径" />
		<cfargument name="source" type="string" required="yes" hint="源文件夹的物理路径" />
		<cfargument name="filter" type="string" required="no" default="*.*" hint="文件通配符, 默认为任意文件 *.*" />
		<cfargument name="recurse" type="boolean" required="no" default="false" hint="是否应用到子文件夹" />
		
		<cfzip source="#arguments.source#" action="zip" file="#arguments.zipfile#" filter="#arguments.filter#" recurse="#arguments.recurse#" />
		
	</cffunction>
	
</cfcomponent>